package designpattern.state;

/**
 * TODO:类描述
 *
 * @className: CheckinState
 * @packageName: designpattern.state
 * @author: Zhuhj
 * @version: V1.0
 * @date: 2021/4/21 20:53
 */
public class CheckinState extends State{
    @Override
    protected void getState() {
        System.out.println("入住状态");
    }

    @Override
    protected void book(Room room) {
        System.err.println("入住状态不能预定");
    }

    @Override
    protected void unbook(Room room) {
        System.err.println("入住状态不能取消预定");
    }

    @Override
    protected void checkin(Room room) {
        System.err.println("入住状态不能入住");
    }

    @Override
    protected void checkout(Room room) {
        System.out.println("离店");
        room.setState(new CheckoutState());
    }
}
